# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-python-geoip-geolite2
pkgname=('python2-python-geoip-geolite2' 'python-python-geoip-geolite2')
_pkgname=python-geoip-geolite2
pkgver=2015.0303
pkgrel=8
pkgdesc='Provides access to the geolite2 database.'
arch=('any')
url='https://pypi.org/project/python-geoip-geolite2/#files'
license=('custom:unknown')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('da382b62b66ac617bd2c0e58452b81c42264de094283385c756ad963f4c3d4ea448a0d66025e2e79f089a9614ade36af9937f63933ba713b88f6fe0c50bb5e31')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-python-geoip-geolite2() {
  depends=('python2' 'python2-python-geoip')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-python-geoip-geolite2() {
  depends=('python' 'python-python-geoip')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

